home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 38 / Amiga Format CD38 (1999-03-15)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-04].iso / -screenplay- / hd_installers / -whdload- / whdload_dev / include / whdload.i
Text File  |  1998-07-16  |  16KB  |  563 lines

  1.  
  2.  IFND WHDLOAD_I
  3. WHDLOAD=1
  4.  
  5.     IFND    EXEC_EXECBASE_I
  6.     INCLUDE    exec/execbase.i
  7.     ENDC
  8.     IFND    EXEC_TYPES_I
  9.     INCLUDE    exec/types.i
  10.     ENDC
  11.     IFND    GRAPHICS_MODEID_I
  12.     INCLUDE    graphics/modeid.i
  13.     ENDC
  14.     IFND    HARDWARE_CIA_I
  15.     INCLUDE    hardware/cia.i
  16.     ENDC
  17.     IFND    HARDWARE_CUSTOM_I
  18.     INCLUDE    hardware/custom.i
  19.     ENDC
  20.     IFND    HARDWARE_INTBITS_I
  21.     INCLUDE    hardware/intbits.i
  22.     ENDC
  23.     IFND    HARDWARE_DMABITS_I
  24.     INCLUDE    hardware/dmabits.i
  25.     ENDC
  26.     IFND    UTILITY_TAGITEM_I
  27.     INCLUDE    utility/tagitem.i
  28.     ENDC
  29.  
  30. ;some custom stuff
  31.  
  32.  BITDEF POTGO,OUTRY,15
  33.  BITDEF POTGO,DATRY,14
  34.  BITDEF POTGO,OUTRX,13
  35.  BITDEF POTGO,DATRX,12
  36.  BITDEF POTGO,OUTLY,11
  37.  BITDEF POTGO,DATLY,10
  38.  BITDEF POTGO,OUTLX,9
  39.  BITDEF POTGO,DATLX,8
  40.  BITDEF POTGO,START,0
  41.  
  42. _ciaa        = $bfe001
  43. _ciab        = $bfd000
  44. _custom        = $dff000
  45.  
  46. ;=============================================================================
  47. ;    misc
  48. ;=============================================================================
  49.  
  50. SLAVE_HEADER    MACRO
  51.         moveq    #-1,d0
  52.         rts
  53.         dc.b    "WHDLOADS"
  54.         ENDM
  55.  
  56. ;=============================================================================
  57. ;    some useful macros
  58. ;=============================================================================
  59.  
  60. ****************************************************************
  61. ***** write opcode ILLEGAL to specified address
  62. ill    MACRO
  63.     IFNE    NARG-1
  64.         FAIL    arguments "ill"
  65.     ENDC
  66.         move.w    #$4afc,\1
  67.     ENDM
  68.  
  69. ****************************************************************
  70. ***** write opcode RTS to specified address
  71. ret    MACRO
  72.     IFNE    NARG-1
  73.         FAIL    arguments "ret"
  74.     ENDC
  75.         move.w    #$4e75,\1
  76.     ENDM
  77.  
  78. ****************************************************************
  79. ***** skip \1 instruction bytes on address \2
  80. skip    MACRO
  81.     IFNE    NARG-2
  82.         FAIL    arguments "skip"
  83.     ENDC
  84.     IFLE \1-126
  85.         move.w    #$6000+\1-2,\2
  86.     ELSE
  87.     IFLE \1-32766
  88.         move.l    #$60000000+\1-2,\2
  89.     ELSE
  90.         FAIL    "skip: distance to large"
  91.     ENDC
  92.     ENDC
  93.     ENDM
  94. ****************************************************************
  95. ***** write \1 times opcode NOP starting at address \2
  96. nops    MACRO
  97.     IFNE    NARG-2
  98.         FAIL    arguments "nops"
  99.     ENDC
  100.         movem.l    d0/a0,-(a7)
  101.         IFGT \1-127
  102.             move.w    #\1-1,d0
  103.         ELSE
  104.             moveq    #\1-1,d0
  105.         ENDC
  106.         lea    \2,a0
  107. .lp\@        move.w    #$4e71,(a0)+
  108.         dbf    d0,.lp\@
  109.         movem.l    (a7)+,d0/a0
  110.     ENDM
  111.  
  112. ****************************************************************
  113. ***** write opcode JMP \2 to address \1
  114. patch    MACRO
  115.     IFNE    NARG-2
  116.         FAIL    arguments "patch"
  117.     ENDC
  118.         move.w    #$4ef9,\1
  119.         pea    \2
  120.         move.l    (a7)+,2+\1
  121.     ENDM
  122.  
  123. ****************************************************************
  124. ***** write opcode JSR \2 to address \1
  125. patchs    MACRO
  126.     IFNE    NARG-2
  127.         FAIL    arguments "patchs"
  128.     ENDC
  129.         move.w    #$4eb9,\1
  130.         pea    \2
  131.         move.l    (a7)+,2+\1
  132.     ENDM
  133.  
  134. ****************************************************************
  135. ***** wait that blitter has finished his job
  136. ***** (this is adapted from graphics.WaitBlit, see autodocs for
  137. *****  hardware bugs and possible problems ...)
  138. ***** if \1 is given it must be an address register containing _custom
  139. BLITWAIT MACRO
  140.     IFEQ    NARG-1
  141.         tst.b    (dmaconr,\1)
  142. .waitb\@    tst.b    (_ciaa)        ;this avoids blitter slow down
  143.         tst.b    (_ciaa)
  144.         btst    #DMAB_BLTDONE-8,(dmaconr,\1)
  145.         bne.b    .waitb\@
  146.         tst.b    (dmaconr,\1)
  147.     ELSE
  148.         tst.b    (_custom+dmaconr)
  149. .waitb\@    tst.b    (_ciaa)        ;this avoids blitter slow down
  150.         tst.b    (_ciaa)
  151.         btst    #DMAB_BLTDONE-8,(_custom+dmaconr)
  152.         bne.b    .waitb\@
  153.         tst.b    (_custom+dmaconr)
  154.     ENDC
  155.     ENDM
  156.  
  157. ****************************************************************
  158. ***** wait of vertical blank
  159. ***** if \1 is given it must be an address register containing _custom
  160. waitvb    MACRO
  161.     IFEQ    NARG-1
  162. .1\@        btst    #0,(vposr+1,\1)
  163.         beq    .1\@
  164. .2\@        btst    #0,(vposr+1,\1)
  165.         bne    .2\@
  166.     ELSE
  167. .1\@        btst    #0,(_custom+vposr+1)
  168.         beq    .1\@
  169. .2\@        btst    #0,(_custom+vposr+1)
  170.         bne    .2\@
  171.     ENDC
  172.     ENDM
  173.  
  174. ****************************************************************
  175. ***** wait for pressing any button
  176. ***** if \1 is given it must be an address register containing _custom
  177. waitbutton    MACRO
  178.     IFEQ    NARG
  179.         move.l    a0,-(a7)
  180.         lea    (_custom),a0
  181. .down\@        bsr    .wait\@
  182.         btst    #CIAB_GAMEPORT0,(ciapra+_ciaa)        ;LMB
  183.         beq    .up\@
  184.         btst    #POTGOB_DATLY-8,(potinp,a0)        ;RMB
  185.         beq    .up\@
  186.         btst    #CIAB_GAMEPORT1,(ciapra+_ciaa)        ;FIRE
  187.         bne    .down\@
  188. .up\@        bsr    .wait\@                    ;entprellen
  189.         btst    #CIAB_GAMEPORT0,(ciapra+_ciaa)        ;LMB
  190.         beq    .up\@
  191.         btst    #POTGOB_DATLY-8,(potinp,a0)        ;RMB
  192.         beq    .up\@
  193.         btst    #CIAB_GAMEPORT1,(ciapra+_ciaa)        ;FIRE
  194.         beq    .up\@
  195.         bsr    .wait\@                    ;entprellen
  196.         bra    .done\@
  197. .wait\@        waitvb    a0
  198.         rts
  199. .done\@        move.l    (a7)+,a0
  200.     ELSE
  201.     IFEQ    NARG-1
  202. .down\@        bsr    .wait\@
  203.         btst    #CIAB_GAMEPORT0,(ciapra+_ciaa)        ;LMB
  204.         beq    .up\@
  205.         btst    #POTGOB_DATLY-8,(potinp,\1)        ;RMB
  206.         beq    .up\@
  207.         btst    #CIAB_GAMEPORT1,(ciapra+_ciaa)        ;FIRE
  208.         bne    .down\@
  209. .up\@        bsr    .wait\@                    ;entprellen
  210.         btst    #CIAB_GAMEPORT0,(ciapra+_ciaa)        ;LMB
  211.         beq    .up\@
  212.         btst    #POTGOB_DATLY-8,(potinp,\1)        ;RMB
  213.         beq    .up\@
  214.         btst    #CIAB_GAMEPORT1,(ciapra+_ciaa)        ;FIRE
  215.         beq    .up\@
  216.         bsr    .wait\@                    ;entprellen
  217.         bra    .done\@
  218. .wait\@        waitvb    \1
  219.         rts
  220. .done\@
  221.     ELSE
  222.         FAIL    arguments "waitbutton"
  223.     ENDC
  224.     ENDC
  225.     ENDM
  226.     
  227. waitbuttonup    MACRO
  228.     IFEQ    NARG
  229.         move.l    a0,-(a7)
  230.         lea    (_custom),a0
  231. .up\@        bsr    .wait\@                    ;entprellen
  232.         btst    #CIAB_GAMEPORT0,(ciapra+_ciaa)        ;LMB
  233.         beq    .up\@
  234.         btst    #POTGOB_DATLY-8,(potinp,a0)        ;RMB
  235.         beq    .up\@
  236.         btst    #CIAB_GAMEPORT1,(ciapra+_ciaa)        ;FIRE
  237.         beq    .up\@
  238.         bsr    .wait\@                    ;entprellen
  239.         bra    .done\@
  240. .wait\@        waitvb    a0
  241.         rts
  242. .done\@        move.l    (a7)+,a0
  243.     ELSE
  244.     IFEQ    NARG-1
  245. .up\@        waitvb    \1                    ;entprellen
  246.         btst    #CIAB_GAMEPORT0,(ciapra+_ciaa)        ;LMB
  247.         beq    .up\@
  248.         btst    #POTGOB_DATLY-8,(potinp,\1)        ;RMB
  249.         beq    .up\@
  250.         btst    #CIAB_GAMEPORT1,(ciapra+_ciaa)        ;FIRE
  251.         beq    .up\@
  252.         waitvb    \1                    ;entprellen
  253.     ELSE
  254.         FAIL    arguments "waitbuttonup"
  255.     ENDC
  256.     ENDC
  257.     ENDM
  258.  
  259. ****************************************************************
  260. ***** flash the screen and wait for LMB
  261. blitz        MACRO
  262.         move    #$1200,bplcon0+_custom
  263.     ;    move    #DMAF_SETCLR|DMAF_RASTER,dmacon+_custom
  264.         move.l    d0,-(a7)
  265. .lpbl\@        move.w    d0,$dff180
  266.         subq.w    #1,d0
  267.         btst    #6,$bfe001
  268.         bne    .lpbl\@
  269.         waitvb            ;entprellen
  270. .lp2bl\@    move.w    d0,$dff180
  271.         subq.w    #1,d0
  272.         btst    #6,$bfe001
  273.         beq    .lp2bl\@
  274.         clr.w    $dff180
  275.         move.l    (a7)+,d0
  276.         ENDM
  277.  
  278. ****************************************************************
  279. ***** install Vertical-Blank-Interrupt which quits on LMB pressed
  280. QUITVBI        MACRO
  281.         move.l    a0,-(a7)
  282.         lea    .vbi,a0
  283.         move.l    a0,$6c
  284.         bra    .g
  285. .vbi        btst    #6,$bfe001
  286.         beq    .vbi+1        ;create "address error"
  287.         move.w    #INTF_VERTB,_custom+intreq
  288.         rte
  289. .g        move.w    #INTF_SETCLR|INTF_INTEN|INTF_VERTB,_custom+intena
  290.         move.w    #INTF_VERTB,_custom+intreq
  291.         move.l    (a7)+,a0
  292.     ENDM
  293.  
  294. ****************************************************************
  295. ***** set all registers to zero
  296. resetregs    MACRO
  297.         moveq    #0,d0
  298.         moveq    #0,d1
  299.         moveq    #0,d2
  300.         moveq    #0,d3
  301.         moveq    #0,d4
  302.         moveq    #0,d5
  303.         moveq    #0,d6
  304.         moveq    #0,d7
  305.         sub.l    a0,a0
  306.         sub.l    a1,a1
  307.         sub.l    a2,a2
  308.         sub.l    a3,a3
  309.         sub.l    a4,a4
  310.         sub.l    a5,a5
  311.         sub.l    a6,a6
  312.     ENDM
  313. ;=============================================================================
  314. ;    return-values for termination (resload_Abort)
  315. ;=============================================================================
  316.  
  317. TDREASON_OK        = -1    ;normal termination
  318. TDREASON_DOSREAD    = 1    ;error with resload_ReadFile
  319.                 ;primary   = dos errorcode
  320.                 ;secondary = file name
  321. TDREASON_DOSWRITE    = 2    ;error with resload_SaveFile/resload_SaveFileOffset
  322.                 ;primary   = dos errorcode
  323.                 ;secondary = file name
  324. TDREASON_DEBUG        = 5    ;make coredump and quit
  325.                 ;primary   = PC
  326.                 ;secondary = SR
  327. TDREASON_DOSLIST    = 6    ;error with resload_ListFiles
  328.                 ;primary   = dos errorcode
  329.                 ;secondary = directory name
  330. TDREASON_DISKLOAD    = 7    ;error with resload_DiskLoad
  331.                 ;primary   = dos errorcode
  332.                 ;secondary = disk number
  333. TDREASON_DISKLOADDEV    = 8    ;error with resload_DiskLoadDev
  334.                 ;primary   = trackdisk errorcode
  335. TDREASON_WRONGVER    = 9    ;an version check (e.g. crc16) has detected an
  336.                 ;unsupported version of data files
  337. TDREASON_OSEMUFAIL    = 10    ;error in the OS emulation module
  338.                 ;primary   = subsystem (e.g. "exec.library")
  339.                 ;secondary = error number (e.g. #_LVOAllocMem)
  340. ; version 7
  341. TDREASON_REQ68020    = 11    ;Slave/installed program requires 68020
  342. TDREASON_REQAGA        = 12    ;Slave/installed program requires AGA Chip Set
  343. TDREASON_MUSTNTSC    = 13    ;installed program needs NTSC to run
  344. TDREASON_MUSTPAL    = 14    ;installed program needs PAL to run
  345.  
  346. ;=============================================================================
  347. ; tagitems for various resload functions
  348. ;=============================================================================
  349.  
  350.  ENUM    TAG_USER+$8000000
  351.  EITEM    WHDLTAG_ATTNFLAGS_GET    ;get exec.AttnFlags 
  352.                  ;(see "Includes:exec/execbase.i")
  353.  EITEM    WHDLTAG_ECLOCKFREQ_GET    ;get exec.EClockFrequency 
  354.                  ;(see "Includes:exec/execbase.i")
  355.  EITEM    WHDLTAG_MONITOR_GET    ;get the used monitor (NTSC_MONITOR_ID or PAL_MONITOR_ID)
  356.  EITEM    WHDLTAG_Private1
  357.  EITEM    WHDLTAG_Private2
  358.  EITEM    WHDLTAG_Private3
  359.  EITEM    WHDLTAG_BUTTONWAIT_GET    ;get value of argument/tooltype ButtonWait/S (0/-1)
  360.  EITEM    WHDLTAG_CUSTOM1_GET    ;get value of argument/tooltype Custom1/N (integer)
  361.  EITEM    WHDLTAG_CUSTOM2_GET    ;get value of argument/tooltype Custom2/N (integer)
  362.  EITEM    WHDLTAG_CUSTOM3_GET    ;get value of argument/tooltype Custom3/N (integer)
  363.  EITEM    WHDLTAG_CUSTOM4_GET    ;get value of argument/tooltype Custom4/N (integer)
  364.  EITEM    WHDLTAG_CUSTOM5_GET    ;get value of argument/tooltype Custom5/N (integer)
  365. ; version 7
  366.  EITEM    WHDLTAG_CBSWITCH_SET    ;set callback function to execute on switch to
  367.                 ;installed program (see autodoc)
  368.  EITEM    WHDLTAG_CHIPREVBITS_GET    ;get gfx.ChipRevBits
  369.                 ;(see "Includes:graphics/gfxbase.i")
  370.  
  371. ;=============================================================================
  372. ; Slave        Version 1..3
  373. ;=============================================================================
  374.  
  375.     STRUCTURE    WhdloadSlave,0
  376.     STRUCT    ws_Security,4    ;moveq #-1,d0 + rts
  377.     STRUCT    ws_ID,8        ;"WHDLOADS"
  378.     UWORD    ws_Version    ;version of Whdload that is required
  379.     UWORD    ws_Flags    ;see below
  380.     ULONG    ws_BaseMemSize    ;size of mem required by game
  381.                 ;(must be multiple of $1000, max=$200000)
  382.     ULONG    ws_ExecInstall    ;address in BaseMem where is space for a fake
  383.                 ;ExecLibrary installed by the WHDLoad to
  384.                 ;survive a RESET
  385.                 ;for example $400
  386.                 ;required are at least 84 Bytes
  387.                 ;=0 means unsupported
  388.     RPTR    ws_GameLoader    ;start of slave-code
  389.                 ;will called from WHDLoad after init in
  390.                 ;SuperVisor
  391.                 ;slave must be 100.00% PC-RELATIVE !
  392.     RPTR    ws_CurrentDir    ;subdirectory in which WHDLoad should search
  393.                 ;for files
  394.     RPTR    ws_DontCache    ;pattern string for files which must not cached
  395.                 ;starting WHDLoad 0.107 this is obsolete
  396.  
  397. ;=============================================================================
  398. ; additional    Version 4..7
  399. ;=============================================================================
  400.  
  401.     UBYTE    ws_keydebug    ;raw key code to quit with debug
  402.                 ;works only if vbr is moved !
  403.                 ;=0 means no key
  404.     UBYTE    ws_keyexit    ;raw key code to exit
  405.                 ;works only if vbr is moved !
  406.                 ;=0 means no key
  407.     LABEL    ws_SIZEOF
  408.  
  409. ;=============================================================================
  410. ; Flags for ws_Flags
  411.  
  412.     BITDEF WHDL,Disk,0    ;means diskimages are used by the slave
  413.                 ;result is a different PRELOAD
  414.                 ;starting WHDLoad 0.107 this is obsolete
  415.     BITDEF WHDL,NoError,1    ;if enabled every error occuring in a 
  416.                 ;resload_#? function will immedately quit the
  417.                 ;slave, and whdload will prompt an error
  418.                 ;requester
  419.     BITDEF WHDL,EmulTrap,2    ;if set and the vbr is moved TRAP #0-15 are
  420.                 ;emulated like the the autovectors
  421.     BITDEF WHDL,NoDivZero,3    ;if set and the VBR is moved by WHDLoad, it
  422.                 ;will not quit if a "Division by Zero"
  423.                 ;exception occurs, a simple rte will performed
  424.                 ;instead
  425. ; version 7
  426.     BITDEF WHDL,Req68020,4    ;indicates that the Slave/installed program
  427.                 ;requires at least a MC68020 cpu
  428.     BITDEF WHDL,ReqAGA,5    ;indicates that the Slave/installed program
  429.                 ;requires the AGA chipset
  430.  
  431. ;=============================================================================
  432. ; resload_#? functions
  433. ; a JMP-tower in WHDLoad (similar to a library)
  434. ; base is given on startup via A0
  435. ;=============================================================================
  436.  
  437.     STRUCTURE    ResidentLoader,0
  438.     ULONG    resload_Install        ;(private)
  439.     ULONG    resload_Abort
  440.         ; return to operating system
  441.         ; IN: (a7) = ULONG success (one of TDREASON_xxx)
  442.         ;   (4,a7) = ULONG primary error code
  443.         ;   (8,a7) = ULONG secondary error code
  444.         ; OUT :    -
  445.         ; DANGER this routine must called via JMP ! (not JSR)
  446.     ULONG    resload_LoadFile
  447.         ; load to BaseMem
  448.         ; IN :    a0 = CPTR  name of file
  449.         ;    a1 = APTR  address
  450.         ; OUT :    d0 = BOOL  success (size of file)
  451.         ;    d1 = ULONG dos errcode (0 if all went ok)
  452.     ULONG    resload_SaveFile
  453.         ; save from BaseMem
  454.         ; IN :    d0 = LONG  length to save
  455.         ;    a0 = CPTR  name of file
  456.         ;    a1 = APTR  address
  457.         ; OUT :    d0 = BOOL  success
  458.         ;    d1 = ULONG dos errcode (0 if all went ok)
  459.     ULONG    resload_SetCACR
  460.         ; sets the CACR (also ok with 68000's and from user-state)
  461.         ; IN :    d0 = ULONG new cacr
  462.         ;    d1 = ULONG mask (bits to change)
  463.         ; OUT :    d0 = ULONG old cacr
  464.     ULONG    resload_ListFiles
  465.         ; list files in dir to buffer
  466.         ; IN :    d0 = ULONG buffer size (a1)
  467.         ;    a0 = CPTR  name of directory to scan (relative)
  468.         ;    a1 = APTR  buffer (MUST reside in Slave !!!)
  469.         ; OUT :    d0 = ULONG amount of listed names
  470.         ;    d1 = ULONG dos errcode (0 if all went ok)
  471.     ULONG    resload_Decrunch
  472.         ; decrunch memory
  473.         ; IN :    a0 = APTR  source
  474.         ;    a1 = APTR  destination (can be equal to source)
  475.         ; OUT :    d0 = BOOL  success (size of file unpacked)
  476.     ULONG    resload_LoadFileDecrunch
  477.         ; IN :    a0 = CPTR  name of file (anywhere)
  478.         ;    a1 = APTR  address (MUST inside BaseMem !!!)
  479.         ; OUT :    d0 = BOOL  success (size of file)
  480.         ;    d1 = ULONG dos errcode (0 if all went ok)
  481.     ULONG    resload_FlushCache
  482.         ; flush all caches
  483.         ; IN :    -
  484.         ; OUT :    -
  485.     ULONG    resload_GetFileSize
  486.         ; IN :    a0 = CPTR  name of file
  487.         ; OUT :    d0 = LONG  size of file or 0 if does'nt exist
  488.     ULONG    resload_DiskLoad
  489.         ; IN :    d0 = ULONG offset
  490.         ;    d1 = ULONG size
  491.         ;    d2 = ULONG disk number
  492.         ;    a0 = APTR  destination
  493.         ; OUT :    d0 = BOOL  success
  494.         ;    d1 = ULONG dos errorcode (if failed)
  495.         
  496. ******* the following functions require ws_Version >= 2
  497.  
  498.     ULONG    resload_DiskLoadDev
  499.         ; IN :    d0 = ULONG offset
  500.         ;    d1 = ULONG size
  501.         ;    a0 = APTR  destination
  502.         ;    a1 = APTR  taglist
  503.         ; OUT :    d0 = BOOL  success
  504.         ;    d1 = ULONG trackdisk errorcode (if failed)
  505.         
  506. ******* the following functions require ws_Version >= 3
  507.  
  508.     ULONG    resload_CRC16
  509.         ; IN :    d0 = ULONG length
  510.         ;    a0 = APTR  address
  511.         ; OUT :    d0 = UWORD crc checksum
  512.  
  513. ******* the following functions require ws_Version >= 5
  514.  
  515.     ULONG    resload_Control
  516.         ; IN :    a0 = APTR  taglist
  517.         ; OUT :    d0 = BOOL  success
  518.     ULONG    resload_SaveFileOffset
  519.         ; save from BaseMem
  520.         ; IN :    d0 = ULONG length to save
  521.         ;    d1 = ULONG offset
  522.         ;    a0 = CPTR  name of file
  523.         ;    a1 = APTR  address
  524.         ; OUT :    d0 = BOOL  success
  525.         ;    d1 = ULONG dos errcode (if failed)
  526.  
  527. ******* the following functions require ws_Version >= 6
  528.  
  529.     ULONG    resload_ProtectRead
  530.         ; IN :    d0 = ULONG length
  531.         ;    a0 = CPTR  address
  532.         ; OUT :    -
  533.     ULONG    resload_ProtectReadWrite
  534.         ; IN :    d0 = ULONG length
  535.         ;    a0 = CPTR  address
  536.         ; OUT :    -
  537.     ULONG    resload_ProtectWrite
  538.         ; IN :    d0 = ULONG length
  539.         ;    a0 = CPTR  address
  540.         ; OUT :    -
  541.     ULONG    resload_ProtectRemove
  542.         ; IN :    d0 = ULONG length
  543.         ;    a0 = CPTR  address
  544.         ; OUT :    -
  545.     ULONG    resload_LoadFileOffset
  546.         ; IN :    d0 = ULONG offset
  547.         ;    d1 = ULONG size
  548.         ;    a0 = CPTR  name of file
  549.         ;    a1 = APTR  destination
  550.         ; OUT :    d0 = BOOL  success
  551.         ;    d1 = ULONG dos errorcode (if failed)
  552.  
  553.     LABEL    resload_SIZEOF
  554.  
  555. ******* compatibility for older slave sources:
  556.  
  557. resload_CheckFileExist = resload_GetFileSize
  558.  
  559. ;=============================================================================
  560.  
  561.  ENDC
  562.  
  563.